package edu.bu.manateem.msg.model.isotope;

public class MassDiffBinController implements BinController 
{
	double maxDiff;

	public MassDiffBinController(double maxDiff) {
		this.maxDiff = maxDiff;
	}

	public boolean bin(Peak peak1, Peak peak2) {
		return bin(peak1, peak2, maxDiff);
	}

	static public boolean bin(Peak peak1, Peak peak2, double maxDiff) {
		return peak1 != null && peak2 != null && Math.abs(peak2.getMass() - peak1.getMass()) < maxDiff;
	}
}
